@layout("/common/_container.html",{js:["/assets/transport/tDispatch/tDispatch_implement.js","/assets/mui/js/photoviewer.js"],css:["/assets/mui/css/photoviewer.css"]}){

<div class="layui-body-header">
    <span class="layui-body-header-title">Dispatch Order Management</span>
</div>
<style type="text/css">
    .layui-table-cell {
        height: auto;
    }
    /*.layui-btn layui-btn-normal layui-btn-xs{
        font-size : 9px;
    }*/
</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form toolbar">
                        <div class="layui-form-item">
		                    <div class="layui-inline">
		                        <select id="tstate">
						            <option value="">Select Transport Status</option>
						            <option value="PENDING_PRICING">PENDING_PRICING</option>
						            <option value="PRICED">PRICED</option>
						            <option value="PENDING_DISPATCH">PENDING_DISPATCH</option>
						            <option value="IN_TRANSIT">IN_TRANSIT</option>
						            <option value="COMPLETED">COMPLETED</option>
		                        </select>
		                    </div>
		                    <div class="layui-inline">
		                        <select id="stateTb">
			            <option value="">Select Report Status</option>
			            <option value="NOT_REPORTED">NOT_REPORTED</option>
			            <option value="PENDING_REPORT">PENDING_REPORT</option>
			        </select>
		                    </div>
                            <div class="layui-inline">
                                <select id="returnTstate">
                                    <option value="">Select Receipt Status</option>
                                    <option value="PENDING_POD">PENDING_POD</option>
                                    <option value="PENDING_EXCEPTION">PENDING_EXCEPTION</option>
                                    <option value="POD_RECEIVED">POD_RECEIVED</option>
                                </select>
                            </div>
		                    <div class="layui-inline" style="width: 150px;">
		                        <input id="startTime" class="layui-input" type="text" autocomplete="off" placeholder="Departure Date From"/>
		                    </div>
                            <div class="layui-inline">
                            	一
                            </div>
		                    <div class="layui-inline" style="width: 150px;">
		                        <input id="endTime" class="layui-input" type="text" autocomplete="off" placeholder="Departure Date To"/>
		                    </div>
		                    <div class="layui-inline">
		                        <select id="operateId" lay-filter="operateId">
			                <option value="">Select Project</option>
		                            @for(item in basicOperatelist!){
		                            <option value="${item.id}">${item.operateName}</option>
		                            @}
		                        </select>
		                    </div>
		                    <div class="layui-inline">
		                        <select id="carrierId" lay-filter="carrierId">
			                <option value="">Select Carrier</option>
		                            @for(item in carrierlist!){
		                            <option value="${item.id}">${item.carrierName}</option>
		                            @}
		                        </select>
		                    </div>
                            <div class="layui-inline">
                                <input id="carrierNames" class="layui-input" type="text" placeholder="Carrier Name"/>
                            </div>
                            <div class="layui-inline">
                                <input id="lineName" class="layui-input" type="text" placeholder="Route"/>
                            </div>
		                    <div class="layui-inline">
               					<input id="condition" class="layui-input" type="text" placeholder="keywords"/>
		                    </div>
		                    <div class="layui-inline">
                				<button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>Search</button>
		                    </div>
<!--                            <div class="layui-inline">-->
<!--                                <button id="btnSearch4" class="layui-btn layui-bg-blue" lay-event="getCheckData" lay-on="test-msg-light"><i class="layui-icon">√</i>批量提报</button>-->
<!--                                <button id="btnSearch5" class="layui-btn layui-bg-red" lay-event="getCheckData" lay-on="test-msg-light"><i class="layui-icon">X</i>撤销提报</button>-->
<!--                            </div>-->
		                    <!-- <div class="layui-inline">
                				<button id="monitoring" class="layui-btn icon-btn layui-btn-warm"><i class="layui-icon">&#xe715;</i>在途监控</button>
		                    </div> -->
		                </div>
		            </div>
                    <table class="layui-table" id="tDispatchTable" lay-filter="tDispatchTable"></table>
                    <table class="layui-table" id="transportReceiptTable" lay-filter="transportReceiptTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="getUnitTpl">
  {{#  if(d.getUnit != ''){ }}
    <span style="color: #1E9FFF;">{{ d.getUnit }}</span>
  {{#  } }}
</script>

<script type="text/html" id="tableBar">
    {{# if(d.tstate === 'IN_TRANSIT'){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="dzqcscz" id="dzqcscz">...</a>
    {{#  } }}
    	<a class="layui-btn layui-btn-danger layui-btn-xs" style="font-size: 7px;" lay-event="chexiaod" id="chexiaod"><i class="layui-icon">&#xe9aa;</i>Cancel</a>
  {{#  if(d.tstate != 'COMPLETED' && d.tstate != 'IN_TRANSIT'){ }}
    	<!--<a class="layui-btn layui-btn-primary layui-btn-xs" style="font-size: 7px;" lay-event="bianjid" id="bianjid"><i class="layui-icon">&#xe642;</i>Edit</a>-->
    	<a class="layui-btn layui-btn-primary layui-btn-xs" style="font-size: 7px;" lay-event="edit" id="edit"><i class="layui-icon">&#xe642;</i>Modify</a>
  {{#  } }}
    	<a class="layui-btn layui-btn-primary layui-btn-xs" style="font-size: 7px;" lay-event="tiaozhengd" id="tiaozhengd"><i class="layui-icon">&#xe642;</i>Adjust Details</a>
    	<a class="layui-btn layui-btn-primary layui-btn-xs" style="font-size: 7px;" lay-event="tiaozhengcost" id="tiaozhengcost"><i class="layui-icon">&#xe642;</i>Adjust Cost</a>
  {{#  if(d.tstate === 'PRICED'){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="daochang" id="daochang">Arrive Warehouse</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="wancheng" id="wancheng">Complete</a>
  {{#  }else if(d.tstate === 'PENDING_DISPATCH'){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="lichang" id="lichang">Leave Warehouse</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="wancheng" id="wancheng">Complete</a>
  {{#  }else if(d.tstate === 'IN_TRANSIT'){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="dianziqianyue" id="dianziqianyue">E-Sign</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="wancheng" id="wancheng">Complete</a>
  {{#  } }}
</script>

<script type="text/html" id="tableBarde">
  {{#  if(d.sdtstate === 'NOT_DELIVERED'|| d.sdtstate == '' || d.sdtstate == null){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="songda" id="songda">Deliver</a>
  {{#  } }}
  {{#  if(d.tstate === 'NOT_RETURNED' || d.tstate == '' || d.tstate == null){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="qianshou" id="qianshou">Sign</a>
  {{#  } else { }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="qianshou_update" id="qianshou_update">Modify Receipt</a>
  {{#  } }}
    <!--<a class="layui-btn layui-btn-xs" lay-event="print" id="print">Print Delivery Note</a>-->
    <a class="layui-btn layui-btn-primary layui-btn-xs" style="font-size: 7px;" lay-event="gaidizhi" id="gaidizhi"><i class="layui-icon">&#xe715;</i>Modify Address</a>
    <!--<a class="layui-btn layui-btn-xs" lay-event="printTy" id="print">Print Quanjin Delivery Note</a>-->
    <a class="layui-btn layui-btn-xs" lay-event="huowu" id="huowu">Goods Details</a>
	<a class="layui-btn layui-btn-xs" lay-event="printHx" id="printHx">Print Retail Delivery Note</a>
    <a class="layui-btn layui-btn-xs" lay-event="printHxCkd" id="printHxCkd">Print Corresponding Delivery Order</a>
<!--    <a class="layui-btn layui-btn-xs" lay-event="updatexsr" id="updatexsr">Change Signer</a>-->
</script>

<script type="text/html" id="paymentProveTpl">
  {{#  if(d.fileId != ''){ }}
    <img src="${ctxPath}/transportReceipt/show?fileId={{d.fileId}}" class="tdImg" style="height:90px;"/>
  {{#  } else { }}
    {{ 'Not Uploaded' }}
  {{#  } }}
</script>

<script type="text/html" id="sdpaymentProveTpl">
  {{#  if(d.sdfileId != ''){ }}
    <img src="${ctxPath}/transportReceipt/show?fileId={{d.sdfileId}}" class="tdImg" style="height:90px;"/>
  {{#  } else { }}
    {{ 'Not Signed' }}
  {{#  } }}
</script>

<script type="text/html" id="dispatchNumberTpl">
  {{#  if(d.dispatchNumber != '' && d.dispatchNumber != null){ }}
    <i class="layui-icon" lay-event="tooDetailed" style="color: #2b85e4;">&#xe615;</i><span>{{ d.dispatchNumber }}</span>
  {{#  } }}
</script>
<script type="text/html" id="consultMoneyTpl">
  {{#  if(d.consultMoney != '' && d.consultMoney != null){ }}
    <i class="layui-icon" lay-event="tooConsultMoneyDetailed" style="color: #2b85e4;">&#xe615;</i><span>{{ d.consultMoney }}</span>
  {{#  } }}
</script>
<script type="text/html" id="mileageTraveledTpl">
    <i class="layui-icon" lay-event="count" style="color: #2b85e4;">&#xe642;</i><span>{{ d.mileageTraveled }}</span>
</script>
<script type="text/html" id="returnTstateTpl">
  {{#  if(d.returnTstate === 'PENDING_POD'){ }}
    <span><i class="layui-icon" lay-event="huidan" style="color: #2b85e4;">&#xe642;</i><span>{{ d.returnTstate }}</span>
	<span><i class="layui-icon" lay-event="yhdyichang" style="color: #FF4500;">&#xe642;</i><span>Exception</span>
  {{#  }else if(d.returnTstate === 'PENDING_EXCEPTION'){ }}
	<span><i class="layui-icon" lay-event="yichangchuli" style="color: #FF4500;">&#xe642;</i><span>{{ d.returnTstate }}</span>
  {{#  }else if(d.returnTstate === 'POD_RECEIVED'){ }}
    <span style="color: #43CF7C;font-weight: 600;">{{ d.returnTstate }}</span>
    <span><i class="layui-icon" lay-event="yhdyichang" style="color: #FF4500;">&#xe642;</i><span>Exception</span>
  {{#  } else { }}
    {{ d.returnTstate }}
  {{#  } }}
</script>
<script type="text/html" id="tableBar4">
    {{#  if(d.zhuangzaiFileid != '' && d.zhuangzaiFileid != null){ }}
    	<i class="layui-icon" lay-event="paymentProve">&#xe64a;</i>
  	{{#  } else { }}
    	<span style="color: #FF4500;font-weight: 600;">Not Uploaded</span>
    {{#   } }}
</script>

@}
